//
//  WLNavigationScrollViewCell.m
//  SleepApp
//
//  Created by MAC on 2021/3/27.
//  Copyright © 2021 RiceWang. All rights reserved.
//

#import "WLNavigationScrollViewCell.h"
#import "WLNavigationScrollModel.h"

@interface WLNavigationScrollViewCell ()
@property (nonatomic,strong) UILabel *title_label;
@end
@implementation WLNavigationScrollViewCell
-(void)bind_row_data:(WLBaseCollectionViewLayerRow *)sender{
    if ([sender.data isKindOfClass:WLNavigationScrollModel.class]){
        WLNavigationScrollModel *model = sender.data;
        self.title_label.text = model.title;
        if (model.isSelect){
            self.title_label.textColor = HexColor(@"333333");
            self.title_label.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium];
        } else {
            self.title_label.textColor = [UIColor colorWithWhite:0 alpha:0.6f];
            self.title_label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
        }
    }
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = UIColor.clearColor;
        [self addSubview:self.title_label];
        [self.title_label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.mas_equalTo(self);
        }];
    }
    return self;
}
-(UILabel *)title_label{
    if (!_title_label){
        _title_label = [[UILabel alloc]init];
        _title_label.textAlignment = NSTextAlignmentCenter;
    }
    return _title_label;
}
@end
